package com.ssy.lingxi.contract.controller;

import com.ssy.lingxi.common.controller.BaseController;
import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.contract.model.vo.sign.response.ContractTemplateSelectResponse;
import com.ssy.lingxi.contract.service.IContractTemplateService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @menu 合同能力 - 下拉框
 * @author yzc
 * @version 2.0.0
 * @date 2020/9/16
 */
@RestController
@RequestMapping("/contract/select")
public class SelectController extends BaseController {

    @Resource
    private IContractTemplateService contractTemplateService;

    /**
     * 电子合同模板查询全部
     * @return 返回结果
     */
    @GetMapping(value = "/listContractTemplate")
    public Wrapper<List<ContractTemplateSelectResponse>> listContractTemplate() {
        UserLoginCacheDTO sysUser = getSysUser();
        return contractTemplateService.listContractTemplate(sysUser);
    }
}
